package com.houor.device.controller.data;

import org.houor.utility.NumberUtility;

/**
 * 上报数据
 * 
 * @author Houor
 *
 * @createTime 2017-04-25 22:28
 */
public abstract class ReportData {

	/**
	 * 控制器设备ID
	 */
	private long deviceId;

	public abstract byte[] getBytes();

	public abstract void init(byte[] content);

	public String toString() {
		StringBuffer sb = new StringBuffer();
		byte[] print = getBytes();

		for (int i = 0; i < print.length; i++) {
			sb.append(NumberUtility.formatStringTo2Length(Integer.toHexString(print[i]))).append(" ");
		}

		return sb.toString();
	}

	public long getDeviceId() {
		return deviceId;
	}

	public void setDeviceId(long deviceId) {
		this.deviceId = deviceId;
	}

}
